/**
 * 封装统一消息提示
 * @param exports
 * @returns
 */
layui.define(['notice'], function(exports){
	var notice = layui.notice;

	var mynotice = {
			// 成功提示
			success: function (message) {
				if(message == undefined || message == ''){
					message = "操作成功！";
				}
				notice.success({
			        title: '信息提示',
			        message: message,
			        position: 'topCenter',
			        transitionIn: 'bounceInDown',
			        transitionOut: 'fadeOutUp',
			        close: false,
			        timeout: 1500,
			        displayMode: 2,
			        progressBar: false
			    });
		    },
		    
		    // 信息提醒
		    info: function (message) {
				if(message == undefined || message == ''){
					message = "请稍后再试";
				}
				notice.info({
			        title: '温馨提示',
			        message: message,
			        position: 'topCenter',
			        transitionIn: 'bounceInDown',
			        transitionOut: 'fadeOutUp',
			        close: false,
			        timeout: 1500,
			        displayMode: 2,
			        progressBar: false
			    });
		    },
		    
		    // 信息提醒
		    infoc: function (message) {
				if(message == undefined || message == ''){
					message = "请稍后再试";
				}
				notice.info({
			        title: '温馨提示',
			        message: message,
			        position: 'center',
			        transitionIn: 'bounceInDown',
			        transitionOut: 'fadeOutDown',
			        close: false,
			        timeout: 1500,
			        displayMode: 2,
			        progressBar: false
			    });
		    },
	
			// 错误提示
			error: function (message) {
				if(message == undefined || message == ''){
					message = "服务器异常！";
				}
				notice.error({
			        title: '错误提示',
			        message: message,
			        position: 'topCenter',
			        transitionIn: 'bounceInDown',
			        transitionOut: 'fadeOutUp',
			        close: false,
			        timeout: 1500,
			        displayMode: 2,
			        progressBar: false
			    });
		    },
		    // 错误提示
			errorc: function (message) {
				if(message == undefined || message == ''){
					message = "服务器异常！";
				}
				notice.error({
			        title: '错误提示',
			        message: message,
			        position: 'center',
			        transitionIn: 'bounceInDown',
			        transitionOut: 'fadeOutDown',
			        close: false,
			        timeout: 1500,
			        displayMode: 2,
			        progressBar: false
			    });
		    },
		    // 加载
		    load: function(message){
		    	notice.msg(message, {icon: 4, close: false, position: 'center'});
		    },
		    // 关闭全部
		    destroy: function(){
		    	notice.destroy();
		    }
	};
	
	exports('mynotice', mynotice)
});